package com.itheima.aduit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.itheima.aduit.mapper2.ProInstanceMapper;
import com.itheima.aduit.pojo.ProcInstance;
import com.itheima.aduit.service.AduitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author qiankaofei
 * @version 1.0
 * @date 2020/12/22 21:01
 */
@Service
public class AduitServiceImpl implements AduitService {


    @Autowired
    private ProInstanceMapper proInstanceMapper;

    /**
     * 根据id查询流程实例
     */
    @Override
    public ProcInstance findInstanceById(String id) {
        QueryWrapper<ProcInstance> procInstanceQuery=new QueryWrapper<ProcInstance>();
        procInstanceQuery.eq("process_id",id);
        ProcInstance procInstance = proInstanceMapper.selectOne(procInstanceQuery);
        if(procInstance==null){
            return null;
        }
        return procInstance;
    }
}
